package com.blog.controller.adminannouncement;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.blog.controller.base.BaseServlet;
import com.blog.entity.NoticeEntity;
import com.blog.service.adminannouncement.AdminNoticeService;

@WebServlet("/adminAllNotice")
public class AdminAllNoticeServlet extends BaseServlet {

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
	}

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//根据条件查询所有的公告
		AdminNoticeService  service = new AdminNoticeService();
		List<NoticeEntity> queryAllNoticeByTypes = service.queryAllNoticeByTypes(0);
		req.setAttribute("queryAllNoticeByTypes", queryAllNoticeByTypes);
		forward("admin/allnotice");
		
	}
}

